package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.valid.ValidInsertGroup;
import com.ruoyi.system.domain.dto.UserBaseInfoDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * 攻略游记对象 bs_strategy
 *
 * @author ruoyi
 * @date 2023-11-25
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@TableName("bs_strategy")
@ApiModel(value = "企业实体")
public class BsStrategy extends BaseEntity {

    private static final long serialVersionUID = 9215212232419406698L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id")
    private Long id;

    @ApiModelProperty(value = "创建人id")
    @TableField(value = "create_by_id", fill = FieldFill.INSERT)
    private Long createById;

    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "图片")
    private String img;

    @NotBlank(message = "定位信息", groups = {ValidInsertGroup.class})
    @ApiModelProperty(value = "定位信息")
    private String address;

    @ApiModelProperty(value = "审核人-姓名")
    private String auditBy;
    @ApiModelProperty(value = "拒绝原因（非必填）")
    private String auditReason;

    @ApiModelProperty(value = "审核状态  0待审核 1已通过 2已驳回")
    private String auditStatus;

    @ApiModelProperty(value = "审核时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date auditTime;

    @TableLogic(value = "0", delval = "1")
    @ApiModelProperty(value = "逻辑删除字段 0：正常 1：删除")
    private String delFlag;

    @ApiModelProperty(value = "点赞-总数")
    @TableField(exist = false)
    private Integer strategyLikeNum;
    @ApiModelProperty(value = "收藏-总数", hidden = true)
    @TableField(exist = false)
    private Integer strategyCollectNum;
    @ApiModelProperty(value = "评论-总数", hidden = true)
    @TableField(exist = false)
    private Integer strategyCommentNum;

    @ApiModelProperty(value = "是否点赞")
    @TableField(exist = false)
    private Boolean checkLike = false;
    @ApiModelProperty(value = "是否收藏")
    @TableField(exist = false)
    private Boolean checkCollect = false;

    @ApiModelProperty(value = "创建人信息")
    @TableField(exist = false)
    private UserBaseInfoDTO createUserInfo;

}
